In the past, in a storage in which data is stored, data predicted to be accessed in near future is accumulated in a cache in advance and, when a readout request for the data is received next, the data is read out from the cache. This method is called “read-ahead”. The read-ahead increases the probability of readout of the data from the cache having high readout speed. Therefore, an access time to the data is reduced. The effect of the read-ahead is expected when a sequential access to the storage continues, i.e., when data in which offsets continue is read out. In particular, in a reproducing apparatus that performs reproduction of sound data and video data, accesses to a storage are sequentially performed in most cases. Therefore, the effect of the read-ahead tends to be produced.
An example of read-ahead processing is shown in FIG. 7. In FIG. 7, processing in a storage, a readout control unit, and a reproduction processing unit is shown. Video data and sound data (hereinafter referred to as AV data) are stored in the storage. The data is read out from the storage on the basis of control by the readout control unit. The readout control unit generates a readout request Ri for instructing readout of the data from the storage. The readout control unit transmits data Dt, which is readout from the storage on the basis of the readout request Ri, to a cache or the reproduction processing unit. The reproduction processing unit reproduces and outputs the AV data accumulated in the cache or the AV data directly read out from the storage.
First, when an acquisition request for specific data is input via a not-shown operation panel or the like, the readout control unit generates a readout request Ri1 for the data on the basis of the input acquisition request for the data and outputs the readout request Ri1. In the readout request Ri1, an access start position (an offset) of a file and an amount (length) of the data to be read out are described. At a point when the readout request Ri1 is issued, data is not accumulated in the cache. Therefore, data Dt1 read out from the storage on the basis of the readout request Ri1 is output to the reproduction processing unit. The read-out data Dt1 is reproduced by the reproduction processing unit.
Subsequently, the readout control unit generates a readout request Ri2 for reading out data Dt2 for length set as read-ahead length in advance. The data Dt2 read out on the basis of the readout request Ri2 is not data that actually needs to be read out but is read-ahead data. Therefore, the data is written in the cache.
After the reproduction of the data Dt1 ends, the reproduction processing unit reads out and reproduces the data Dt2 accumulated in the cache rather than reading out the next data from the storage. While the data Dt2 is read out from the cache by the reproduction processing unit, data Dt3 that needs to be reproduced next is read out from the storage and accumulated in the cache. In order for the reproduction processing unit to immediately perform reproduction of the data Dt3 at a point when finishing reproducing the data Dt2, writing of the data Dt3 in the cache needs to be performed before the reproduction processing unit finishes reproducing the data Dt2. In other words, the writing of the data Dt3 in the cache needs to be performed before all the data Dt2 is read out from the cache.
By performing such read-ahead, since the number of times of accesses to the storage is reduced, data readout speed is increased. Further, in a reproducing apparatus that needs to not only perform reproduction of AV data but also perform multitask processing such as editing and transfer of a file to an external apparatus, efficiency of use of a storage can be improved by performing the read-ahead. This is because, by performing the read-ahead, since the frequency of accesses to the storage caused by one task can be reduced, time in which plural tasks can use the storage increases.
From the viewpoint of improving the efficiency of use of the storage, the size of data read out from the storage at one time is desirably as large as possible. This is because an overhead (readout processing time) consumed during data readout from the storage is fixed regardless of the size of data to be read out. FIGS. 8A to 8C are diagrams showing differences in total processing time between a case of a readout size of data set small and a case of the readout size data set large. FIG. 8A is a diagram of data requested to be read out. The width in the abscissa direction of a frame inscribed as “readout request data” indicates the size of the data. FIG. 8B is a diagram for explaining processing performed when the data requested to be read out is dividedly read out from the storage twice. FIG. 8C is a diagram for explaining processing performed when the data requested to be read out is read out from the storage at one time. In other words, FIG. 8B is a diagram of an example of the readout size of the data to be read out set small. FIG. 8C is a diagram of an example of the readout size set large.
Time consumed for processing performed during readout of the data described as “readout processing time” in FIGS. 8B and 8C is shown as the same length in FIGS. 8B and 8C. It is seen that the time is fixed regardless of the size of data to be actually read out. Therefore, as shown in FIG. 8B, when the size of data read out at one time is set small, a total processing time is extended because of the size of the data. On the other hand, as shown in FIG. 8C, when the size of data read out at one time is set large, a total time consumed for readout of the data can be reduced by the “readout processing time” from that in the processing shown in FIG. 8B. In other words, when the multitask processing is performed, the efficiency of use of the storage can be improved when an amount of data read out at one time from the storage is set large.
However, even if the read-ahead is performed or an amount of data to be read ahead is set large to improve the efficiency of use of the storage, when an access position of a file is designated by a random access, the efficiency of use of the storage is not realized.
FIG. 9 is a diagram of an example of readout processing performed when a data acquisition request by a random access is generated in a state in which a sequential access to the storage continues. First, the data Dt1 is read out from the storage on the basis of the readout request Ri1 transmitted from the readout control unit. While the read-out data Dt1 is reproduced by the reproduction processing unit, the data Dt2 that should be subsequently reproduced is read out to the cache on the basis of the readout request Ri2.
It is assumed that a data acquisition request by a random access is input. In this case, in a readout request Ri3 generated on the basis of this request, an offset in the readout request Ri3 does not have continuity from an offset of the data Dt2 already read out to the cache. In other words, the data Dt2 written on the cache may be unable to be used as a file to be reproduced by the reproduction processing unit. Therefore, the data Dt3 to be reproduced by the reproduction processing unit is read out anew from the storage rather than from the cache. In such a case, time in which the data Dt3 is read out from the storage directly leads to a delay in a readout response. In other words, when not only a sequential access but also a random access to the storage is performed, it is difficult to simultaneously satisfy the efficient use of the storage and the improvement of a response.
For example, JP-A-09-185462 describes a technique for enabling read-ahead of data and increasing the speed of a file data access or the like even in an access pattern regarded as a random access in the past.